package com.xudu;

import com.github.pagehelper.PageInfo;
import com.xudu.entity.Student;
import com.xudu.mapper.StudentMapper;
import com.xudu.service.IFileService;
import com.xudu.service.IStudentService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

/**
 * ClassName: testStudent
 * Description:
 *
 * @Author xudu
 * @Create 2024/4/21
 */
@SpringBootTest
public class testStudent {
    @Autowired
    private IStudentService iStudentService;

    //测试成功 但postman失败
    @Test
    public void testadd(){
        Student student = new Student();
        student.setId(1008);
        student.setName("88");
        student.setSex("88");
        student.setEmail("88");
        student.setAddress("88");
        iStudentService.add(student);
    }

    @Test
    public void testdelete(){
        Student student = new Student();
        student.setId(1003);
        iStudentService.del(student);
    }

    @Test
    public void testupdate(){
        Student student = new Student();
        student.setId(1005);
        student.setName("xiaoming");
        iStudentService.update(student);
    }

    @Test
    public void testgetall(){
        List<Student> all = iStudentService.getAll();
        System.out.println(all);
    }

    @Test
    public void testpage(){
        PageInfo<Student> page = iStudentService.page(1, 2);
        System.out.println(page);


    }

}
